package com.treetao.union.db;

import java.util.HashMap;
import java.util.Map;

public final class Const {
	public static final String skillRedisKey = "_skill_";//秒杀缓存hkey
	public final static Map<String, String> status = new HashMap<String, String>();
	static {
		status.put(OrderStatus.CREATE.getValue()+"", "订单创建");
		status.put(OrderStatus.CANCLE_USER.getValue()+"", "用户取消订单");
		status.put(OrderStatus.CANCLE_SYSTEM.getValue()+"", "系统取消订单");
		status.put(OrderStatus.PREPAYED.getValue()+"", "订单支付(未对账)");
		status.put(OrderStatus.PAYED.getValue()+"", "订单支付(已对账)");
		status.put(OrderStatus.SEND.getValue()+"", "已发货");
		status.put(OrderStatus.RECEIVED_USER.getValue()+"", "用户已确认收货");
		status.put(OrderStatus.RECEIVED_SYSTEM.getValue()+"", "系统确认收货");
		status.put(OrderStatus.COMMENTED.getValue()+"", "已评论");
	}
	
	public static enum OrderStatus {
		CREATE(10),//订单创建
		CANCLE_USER(11),//用户取消订单
		CANCLE_SYSTEM(12),//系统取消订单
		PREPAYED(19),//订单支付(未正式收到微信回调通知)
		PAYED(20),//订单已支付(微信已回调)
		SEND(30),//订单已发货
		RECEIVED_USER(40),//用户确认收货
		RECEIVED_SYSTEM (50),//系统确认收货
		COMMENTED(60),//订单已评论
		REFUND(70);//订单已退款
		
		private int value;
		private OrderStatus(int status) {
			this.value = status;
		}
		public int getValue() {
			return value;
		}
		public void setValue(int value) {
			this.value = value;
		}
		/**
		 * 获取 订单显示文字
		 * @param status
		 * @return
		 */
		public static String getStatusStr(Integer status) {
			return Const.status.get(String.valueOf(status));
		}
		
	}
	/**
	 * 订单查询类型
	 * @author devm
	 *
	 */
	public static class OrderQueryType {
		public static final String ALL = "all";
		public static final String PAY = "pay";
		public static final String REVEIVE = "receive";
		public static final String COMMENT = "comment";
		public static final String FINISH = "finish";
	}
	public static class OrderRecord {
		public static final String CREATE = "订单创建";
		public static final String CANCLE = "订单已取消";
		public static final String PAYED = "订单已支付";
		public static final String SEND = "订单已发货";
		public static final String RECEIVED = "订单已收货";
		public static final String COMMENTED = "完成所有商品评论";
	}
	public static class Cache {
		public static final String SKU = "skuCache";
		public static final String SKU_STOCK = "skuStock_%s";//某个SKU库存
	}
	public static class PayWay {
		public static final String WEIXIN = "weixin";
		public static final String ALIPAY = "alipay";
	}
	public static class PayType {
		public static final String PAY = "pay";
		public static final String REFUND = "refund";
	}
	
	public static class SettingType {
		/**
		 * 微信设置
		 */
		public static final String WEIXIN = "weixin";
		/**
		 * 订单设置
		 */
		public static final String ORDER = "order";
		/**
		 * 系统设置
		 */
		public static final String SYSTEM = "system";
	}
}
